home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / Subforms i22057722001.psc / files for demo / subformCTL / CLS / subclass.cls < prev   
Encoding:
Visual Basic class definition  |  2001-05-10  |  3.1 KB  |  70 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "GSubclass"
  10. Attribute VB_GlobalNameSpace = True
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = True
  14. Option Explicit
  15. ' ===========================================================================
  16. ' Copyright « 1998 Steve McMahon (steve@dogma.demon.co.uk)
  17. ' Visit vbAccelerator - free, advanced source code for VB programmers.
  18. '     http://vbaccelerator.com
  19. ' ---------------------------------------------------------------------------
  20. ' FREE SOURCE CODE! - ENJOY.
  21. ' - Please report bugs to the author for incorporation into future releases
  22. ' - Don't sell this code.
  23. ' ===========================================================================
  24. '
  25. 'Note:
  26. 'You are free to use and modify any of the code on the site,
  27. 'but not to distribute modified versions of my downloads,
  28. 'ActiveX DLLs or OCXs with the same filename and/or ProgIds.
  29. 'If you have made changes which you think are beneficial,
  30. 'or have bug reports, then you can email me
  31. '(steve@vbaccelerator.com) and I will do my utmost to get the a new version
  32. 'on the site.
  33. 'You can freely distribute the zips available from this site to other ones,
  34. 'but you must distribute them in their original state and particularly keep
  35. 'the information and disclaimer text file with the zip (if it has one!).
  36. 'Notification would be greatly appreciated!
  37. 'You can freely distribute any compiled code on the site,
  38. 'or any products you build using the code.
  39. 'If you wish to distribute the source code files by any other means
  40. '(i.e. if you want to include it on a CD or any other software media)
  41. 'then the EXPRESS PERMISSION of the author is REQUIRED
  42. ' ===========================================================================
  43.  
  44. Sub AttachMessage(iwp As ISubclass, ByVal hwnd As Long, _
  45.                   ByVal iMsg As Long)
  46. Attribute AttachMessage.VB_Description = "Start subclassing for a particular message."
  47.     MSubclass.AttachMessage iwp, hwnd, iMsg
  48. End Sub
  49.  
  50. Sub DetachMessage(iwp As ISubclass, ByVal hwnd As Long, _
  51.                   ByVal iMsg As Long)
  52. Attribute DetachMessage.VB_Description = "Stop subclassing for a particular message."
  53.     MSubclass.DetachMessage iwp, hwnd, iMsg
  54. End Sub
  55.  
  56. Public Property Get CurrentMessage() As Long
  57. Attribute CurrentMessage.VB_Description = "Returns the message currently being worked on.  Only valid in the MsgResponse and WindowProc items of your implemented interface."
  58.    CurrentMessage = MSubclass.CurrentMessage
  59. End Property
  60. Public Function CallOldWindowProc( _
  61.       ByVal hwnd As Long, _
  62.       ByVal iMsg As Long, _
  63.       ByVal wParam As Long, _
  64.       ByVal lParam As Long _
  65.    ) As Long
  66. Attribute CallOldWindowProc.VB_Description = "Calls the window procedure for this handle which was installed before you added the subclass."
  67.    CallOldWindowProc = MSubclass.CallOldWindowProc(hwnd, iMsg, wParam, lParam)
  68. End Function
  69.  
  70.